package com.yuncheng.spcyApi.spcy;

import com.yuncheng.spcyApi.alog.annotation.Log;
import com.yuncheng.spcyApi.flow.SpcyFlowConstant;
import com.yuncheng.spcyApi.flow.XzswspFlowService;
import com.yuncheng.vo.HttpResult;
import com.yuncheng.spcyApi.vo.common.HttpResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author hua
 */
@Api(tags = "检查员相关审批流程管理")
@RestController
@RequestMapping("/api/spzx-spcy/jcysplc")
public class JcySpFlowController {

    @Resource
    @Lazy
    private XzswspFlowService xzswspFlowService;

    @Log(title = "发起检查员聘任-拟聘名单流程")
    @ApiOperation(value = "发起检查员聘任-拟聘名单流程")
    @GetMapping(value = "initJcyPrInNpmdlc")
    public HttpResult initJcyPrInNpmdlc(@RequestParam(value = "fprjbxxid",defaultValue = "")String fprjbxxid){
         return HttpResult.ok(xzswspFlowService.initJcyPrInNpmdlc(fprjbxxid));
    }

    @Log(title = "发起检查员聘任-聘任名单确认流程")
    @ApiOperation(value = "发起检查员聘任-聘任名单确认流程")
    @GetMapping(value = "initJcyPrInPrmdqrlc")
    public HttpResult initJcyPrInPrmdqrlc(@RequestParam(value = "fprjbxxid",defaultValue = "")String fprjbxxid){
        return HttpResult.ok(xzswspFlowService.initJcyPrInPrmdqrlc(fprjbxxid));
    }

    @Log(title = "发起检查员遴选-报名审核流程")
    @ApiOperation(value = "发起检查员遴选-报名审核流程")
    @GetMapping(value = "initJcyLxInBmshlc")
    public HttpResult initJcyLxInBmshlc(@RequestParam(value = "flxjhid",defaultValue = "")String flxjhid){
        return HttpResult.ok(xzswspFlowService.initJcyLxInBmshlc(flxjhid));
    }

    @Log(title = "发起检查员遴选-确认名单流程")
    @ApiOperation(value = "发起检查员遴选-确认名单流程")
    @GetMapping(value = "initJcyLxInQrmdlc")
    public HttpResult initJcyLxInQrmdlc(@RequestParam(value = "flxjhid",defaultValue = "")String flxjhid){
        return HttpResult.ok(xzswspFlowService.initJcyLxInQrmdlc(flxjhid));
    }

    @Log(title = "发起检查员解聘-确认名单流程")
    @ApiOperation(value = "发起检查员解聘-确认名单流程")
    @GetMapping(value = "initJcyJpInQrmdlc")
    public HttpResult initJcyJpInQrmdlc(@RequestParam(value = "fprjbxxid",defaultValue = "")String fprjbxxid){
        return HttpResult.ok(xzswspFlowService.initJcyJpInQrmdlc(fprjbxxid));
    }


    @Log(title = "获取检查员聘任-拟聘名单流程-审批列表")
    @ApiOperation(value = "获取检查员聘任-拟聘名单流程-审批列表")
    @GetMapping(value = "queryJcyPrInNpmdlcList")
    public HttpResult queryJcyPrInNpmdlcList(@RequestParam(value = "fprjbxxid",defaultValue = "")String fprjbxxid){

        return HttpResultVo.HttpResultList(xzswspFlowService.queryOaJobList(fprjbxxid, SpcyFlowConstant.JCYPR_LCLX_NPMD));
    }

    @Log(title = "获取检查员聘任-聘任名单确认流程-审批列表")
    @ApiOperation(value = "获取检查员聘任-聘任名单确认流程-审批列表")
    @GetMapping(value = "queryJcyPrInPrmdqrlcList")
    public HttpResult queryJcyPrInPrmdqrlcList(@RequestParam(value = "fprjbxxid",defaultValue = "")String fprjbxxid){

        return HttpResultVo.HttpResultList(xzswspFlowService.queryOaJobList(fprjbxxid, SpcyFlowConstant.JCYPR_LCLX_QRMD));
    }

    @Log(title = "获取检查员遴选-报名审核流程-审批列表")
    @ApiOperation(value = "获取检查员遴选-报名审核流程-审批列表")
    @GetMapping(value = "queryJcyLxInBmshLcList")
    public HttpResult queryJcyLxInBmshLcList(@RequestParam(value = "flxjhid",defaultValue = "")String flxjhid){

        return HttpResultVo.HttpResultList(xzswspFlowService.queryOaJobList(flxjhid, SpcyFlowConstant.JCYLX_LCLX_LXBMSH));
    }

    @Log(title = "获取检查员遴选-确认名单流程-审批列表")
    @ApiOperation(value = "获取检查员遴选-确认名单流程-审批列表")
    @GetMapping(value = "queryJcyLxInQrmdLcList")
    public HttpResult queryJcyLxInQrmdLcList(@RequestParam(value = "flxjhid",defaultValue = "")String flxjhid){

        return HttpResultVo.HttpResultList(xzswspFlowService.queryOaJobList(flxjhid, SpcyFlowConstant.JCYLX_LCLX_LXQRMD));
    }

    @Log(title = "获取检查员解聘-确认名单流程-审批列表")
    @ApiOperation(value = "获取检查员解聘-确认名单流程-审批列表")
    @GetMapping(value = "queryJcyJpInQrmdLcList")
    public HttpResult queryJcyJpInQrmdLcList(@RequestParam(value = "fjpjbxxid",defaultValue = "")String fjpjbxxid){

        return HttpResultVo.HttpResultList(xzswspFlowService.queryOaJobList(fjpjbxxid, SpcyFlowConstant.JCYPR_LCLX_JPMDQR));
    }

    @Log(title = "行政事务流程-查看")
    @ApiOperation(value = "行政事务流程-查看")
    @GetMapping(value = "viewXzswlc")
    public HttpResult viewXzswlc(@RequestParam(value = "jobid",defaultValue = "") String jobid){

        return HttpResult.ok(xzswspFlowService.queryXzswspJobInfo(jobid));
    }

    @Log(title = "行政事务流程-删除")
    @ApiOperation(value = "行政事务流程-删除")
    @DeleteMapping(value = "deletXzswlc")
    public HttpResult deletXzswlc(@RequestParam(value = "jobid",defaultValue = "") String jobid){

        xzswspFlowService.deleteXzswspJobById(jobid);
        return HttpResult.ok("删除成功");
    }


}
